StupidBeauty
Read times:373Posted at:Thu Jan 5 01:17:03 2012
- no title specified

转载:Qt4 Gossip: QTcpServer

QTcpServer,使用listen函数监听端口,有新连接到来时,會发射newConnection信号,这时,可使用nextPendingConnection函数获取对应于新连接的QTcpSocket对象。奏是这麽简单。

http://caterpillar.onlyfun.net/Gossip/Qt4Gossip/QTcpServer.html

亮点:

QTcpSocket 用來與遠端伺服器連線,如果您要接受客戶端連線,則使用 QTcpServer QTcpServer 使用 listen() 方法開始傾開所指定的連接埠,您 可以使用 isListening() 方法測試是否正在傾聽連線,當連線發生時, QTcpServer 會發出 newConnection() Signal ,您可以使用 QTcpServer nextPendingConnection() 取得代表客戶端連線的 QTcpSocket 物件,接下來 就可以使用它來與客戶端進行資料傳輸。

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4